local skill = fk.CreateSkill {
  name = "#lvshi__wonder_map_skill",
  tags = { Skill.Compulsory },
  attached_equip = "lvshi__wonder_map",
}

skill:addEffect(fk.AfterCardsMove, {
  can_trigger = function(self, event, target, player, data)
    if player.dead or player:getHandcardNum() >= 4 then return end
    for _, move in ipairs(data) do
      if move.from == player then
        for _, info in ipairs(move.moveInfo) do
          if info.fromArea == Card.PlayerEquip and Fk:getCardById(info.cardId).name == skill.attached_equip then
            return Fk.skills[skill.name]:isEffectable(player)
          end
        end
      end
    end
  end,
  on_use = function(self, event, target, player, data)
    local n = 4 - player:getHandcardNum()
    player:drawCards(n, skill.name)
  end,
})

return skill